<%@page import="com.dfhc.bus.busmessagerecipients.IMessageRecipientsConstants" %>
<%@page import="com.dfhc.util.StringHelper"%>
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />

<!-- 全局js 和css包 -->
<%@ include file="/jsp/include/web/new/global.jsp" %>

<title>添加消息收件人 </title>

<%@ taglib uri="/dfhc" prefix="dfhc" %>
</head>
<body>


<article class="page-container">
	<form action="" method="post" class="form form-horizontal" id="form-busmessagerecipients-add">
	   <input type="hidden" id="id" name="id" value="${bean.id}">
	   <input type="hidden" id="messageId" name="messageId" value="${messageId}">							

	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IMessageRecipientsConstants.TABLE_COLUMN_DISPLAY.get("recipientId")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.recipientId}" placeholder="" id="recipientId" name="recipientId"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IMessageRecipientsConstants.TABLE_COLUMN_DISPLAY.get("recipient")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.recipient}" placeholder="" id="recipient" name="recipient"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IMessageRecipientsConstants.TABLE_COLUMN_DISPLAY.get("orderTaskId")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.orderTaskId}" placeholder="" id="orderTaskId" name="orderTaskId"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IMessageRecipientsConstants.TABLE_COLUMN_DISPLAY.get("orderNum")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.orderNum}" placeholder="" id="orderNum" name="orderNum"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=IMessageRecipientsConstants.TABLE_COLUMN_DISPLAY.get("messageStatus")%>：</dfhc:title>	    
			<dfhc:div templateId="h_ui_div_fromcontrol">
				<dfhc:select templateId="h_ui_select" size="1" name="messageStatus" id="messageStatus" pleaseSelect="1" defaultValue="${bean.messageStatus}" sqlOption="code" code="MESSAGE_STATUS" />				
			</dfhc:div>
	  </dfhc:div>
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IMessageRecipientsConstants.TABLE_COLUMN_DISPLAY.get("receivingTime")%>：</dfhc:title>	    
            <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_timestamp_input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="${bean.receivingTime}" id="receivingTime" name="receivingTime" readonly="true" />
	    </dfhc:div>	    		 
	  </dfhc:div>
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IMessageRecipientsConstants.TABLE_COLUMN_DISPLAY.get("sendFlag")%>：</dfhc:title>	    
			<dfhc:div templateId="h_ui_div_fromcontrol">
				<dfhc:select templateId="h_ui_select" size="1" name="sendFlag" id="sendFlag" pleaseSelect="1" defaultValue="${bean.sendFlag}" sqlOption="code" code="RM_YES_NOT" />				
			</dfhc:div>
	  </dfhc:div>
	 <dfhc:div templateId="h_ui_div_row_cl">
		<dfhc:div templateId="h_ui_div_pop_up_button">
			<dfhc:button templateId="h_ui_submit_button" />
		</dfhc:div>
	</dfhc:div>
	</form>
</article>


<script type="text/javascript">
$(function(){
	//获取新id
	<c:if test="${empty bean}"> 
	$('#id').val(getNewId('<%=IMessageRecipientsConstants.TABLE_NAME%>'));
	</c:if>


	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});

$("#form-busmessagerecipients-add").validate({
		rules:{
			recipient:{			
				maxlength:200
			},
			orderNum:{			
				maxlength:19
			},
			messageStatus:{			
				required:true,
				minlength:1,
				maxlength:2
			},
			receivingTime:{			
			},
			sendFlag:{			
				maxlength:1
			}
		},
 		messages: {
			recipient:{
		        maxlength: "接收人最大长度为200个字母"
	           },
			orderNum:{
		        maxlength: "接收订单编号最大长度为19个字母"
	           },
			messageStatus:{
		        required: "请输入消息状态",
		        minlength: "消息状态至少由1个字母组成",
		        maxlength: "消息状态最大长度为2个字母"
	           },
			receivingTime:{
	           },
			sendFlag:{
		        maxlength: "是否已发送最大长度为1个字母"
	           }
	    },		
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			<c:if test="${empty bean}"> 
			var url = getRootPath()+"/busmessagerecipients/insert?jsguid="+$('#id').val();
			</c:if>
			<c:if test="${not empty bean}"> 
			var url = getRootPath()+"/busmessagerecipients/update?jsguid="+$('#id').val();
			</c:if>
			//提交成功关闭
			submitAjax(url,$("#form-busmessagerecipients-add").serialize()); 		    		    		
		}
	});	

});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
